#include <stdio.h>

int main(int argc, char**argv)
{
    FILE* fp1 = fopen(argv[1], "r");
    if(fp1 == NULL)
    {
        perror("fopen 1 error:");
        return -1;
    }
    FILE* fp2 = fopen(argv[2], "w");
    if(fp2 == NULL)
    {
        perror("fopen 2 error:");
        return -1;
    }

    while(1)
    {
        char buf[16] = {0};
        fgets(buf,16,fp1);
        printf("__%d__\n",__LINE__);
        
        if(ferror(fp1))
            break;
        fputs(buf, fp2);
        if(feof(fp1))
            break;
    }

    fclose(fp1);
    fclose(fp2);
}
